Demystifying Computers

How They Really Work

Osher Lifelong Learning Institute
University of Illinois, Urbana-Champaign

Scott Badman, Instructor


Operating Systems (Windows)

Common Operating Systems

IBM Mainframes - OS 360 to current z/OS (generally backward compatible)

Unix derived Operating Systems

Various flavors of Unix (used on medium and large computers, including some IBM mainframes)

Linux (Personal Computers)

Mac 0S/X (Mac OS before OS/X was a completely different operating system, going back to the original MacIntosh)

Original Microsoft DOS and Windows 3 through Windows 95, 98, and Millenium Edition

Windows NT through current Windows 2000, Vista, 7 and 8

Smart Phone and Tablet Computers (mostly derived from Linux)

Apple's iOS, Android, Symbian, Windows RT, and many others

Operating System Functions

1. Load and run programs, and manage program libraries (.dll files on Windows)

Earliest - 1950's

2. Multiprocessing

Mid 60's

3. Manage memory

Mid 60's along with multiprocessing

4. Almost all Input / Output - includes all disk and network I/O

System 360 for IBM mainframes (mid-60's), with the rise of Unix (early '70's) for all other computers.

5. Manage multiple users

Along with terminals (60's) for mainframes, '70's for Unix, '90's for Windows and Mac

6. Security

Along with terminals (60's) for mainframes, along with rise of Internet (mid-'90's) for Personal Computers

Security became more important as multiple terminals were added (60's for mainframes) and computers were interconnected (starting in the '70's for all computers), and growing exponentially with the advent of the Internet (1990's).

Load and run programs, multiprocessing, and memory management

Virtual Memory

Illustrate with Resource Montior (resmon) or Task Manager (taskmgr or ctrl-alt-del, then click the Task Manager button)

Problem with loading a program in memory, must adjust all the addresses in some way

Solution -- program assumes all addresses start at 0, and operating system adds the real lowest address to all program addresses.

Every program assumes it has the entire memory to itself

If the computer runs out of real memory, it swaps sectors of memory to and from a disk drive.

"Thrashing" (too much swapping to disk) if the computer is overloaded with programs.

Use thrasher.cpp to illustrate, along with Windows Task Manager's Performance display.

thrasher.cpp and >>> careful, this will slow down your computer >>> thrasher.exe

The "Protection Bit" in the CPU protects the memory the Operating System uses from access by any program.

crasher.cpp and >>> careful, this will crash and create a protection error >>> crasher.exe

Applications, Processes, Threads, and Services

Resource Monitor (resmon) or Windows Task Manager (taskmgr or ctrl-alt-del, then click the Task Manager button)

An application is a program started by the user. All applications must run in a process. The operating system is concerned mainly with processes, not applications.

Task Manager (press Start - run - and type in: taskmgr or press ctrl-alt-del (all together), then click the Task Manager button)

Illustration: Task Manager Applications tab

A process creates at least one thread, and can create additional threads of code. The operating system actually runs only the threads.

Illustration: 2 threads being used in FreeFileSync file scan

A service, called a Daemon in Unix and Linux, is a process that runs in the background to do a specfic task.

Usually run by the svchost process

Process Priority.

Task Manager (press Start - run - and type in: taskmgr or press ctrl-alt-del (all together), then click the Task Manager button)

Illustration: Task Manager Performance tab

Changing the Priority in Windows Task Manager Processes tag.

Use 5 running instances of monopolizeCPU.exe and Windows Task Manager to see CPU useage. Then change priorities on the fly and watch the CPU priority change.

monopolizeCPU.cpp and

>>> this program will use a lot of CPU time, but even multiple copies can be run without slowing the computer using normal priorities >>> monopolizeCPU.exe

Operating System Directories

C:\ (root directory)

Windows (directory that holds most of the files that make up the Windows Operating System)

System32 (subdirectory of Windows that holds the files for Windows' most fundamental tasks)

Program Files (directory that holds most of the files for the applciations you have installed on your computer)

users (directory that holds the personal files for each user)

users\your_user_name (subdirectory that holds your files)

users\your_user_name\documents (subdirectory that holds your documents)

users\your_user_name\desktop (subdirectory that holds the files on your desktop)

Operating System File Types

.exe (file extension for an application)

.dll (dynamic link library - file extension for addtional code used by an application)

.drv (driver - file extension for addtional code used by the operating system to connect to input / output periferals)

Input / Output

Extensive: Storage Drives, Graphical User Interface (GUI), Networking, Audio, Universal Serial Bus (USB) connection.

Disk Management (press Start - Control Panel - switch to Classic View - Administrative Tools - Computer Management - Storage - Disk Management)

BE VERY, VERY CAREFUL - don't change anything!

Physical and Logical (letter:) Disks

Illustration: Physical and Virtual Disks

Virtual Drives

The "letter drives" in Windows, such as C:\ are virtual drives, not necessarily physical drives.

Control Panel - Classic View - Administrative Tools - Computer Management - Storage - Disk Management

Be very careful, don't change anything.

MacIntosh and Unix computers do not have "letter drives", but a single virtual file system accross multiple physical and network drives from a single local virtual root directory, called / .

Drivers installed in the operating system

I/O devices are often complete specialized computers

Communication by Protocols between the motherboard chipset and the I/O device controller (it's specialize Application Specific Integrated Circuit (ASIC), essentally its CPU)

Registry

Where Windows keeps specific information about the hardware and programs installed on this particular computer.

Very complicated, very important, and very easy to corrupt.

Only experts who really know what they are doing should modify the Registry (by using regedit).

Running a good quality Registry Cleaning Program is a good idea however.

Startup

32 Bit Intel processors automatically jump to memory location 0xFFFFFFF0 (16 bytes short of the end of 4 GigaBytes of memory)

Allows the motherboard to have immediate control of Program Counter, while leaving all memory below for any configuration.

This memory address is hardware coded by the motherboard to jump to the beginning of the Basic Input Output System (BIOS) Boot Entry Point, usually between 640 KiloBytes and 1 MegaBtye, which is normally Flash Memory.

BIOS

Performs Power On Self Test (POST)

Tests just the basics - Memory, Keyboard, and Video (not the mouse)

Beeps and stops if there is a problem

Puts up Manufacturers Splash Screen

Usually gives user a choice to enter the Configuration Menu by pressing an F Button

Allows changes to the comfiguration stored in flash memory

BIOS Booting Process

Implements the configuration stored in flash memory

Inventories the Disk Drives actually attached to the computer, and in modern computers, the USB ports

Necessary to do next step, load the operating system.

Finds the first physical disk drive in configuration that is actually attached

Error: "Non-System Disk or Disk Error"

Loads the Master Boot Record from the beginning of that drive into the area from 0 to 640 Kilobytes in memory (which is RAM, not Flash memory) usually at 0x7C00 (31744 Decimal).

This allows multiple operating systems on the same disk.

Master Boot Record

Consists of Boot Strap Loader and Partition Table.

Boot Strap Loader checks the Partition Table and finds which operating system it should load

Possibly could give a screen to choose operating sytem to the user.

Errors: "Invalid Partition Table", "No Bootable Disk Found", or "Missing Operating System".

Loads the beginning of the correct Operating System, called the "Boot Sector" on the disk (as listed in the Partition Table), switches to protected mode and transfers control.

Operating System (Windows) Boot Sector, called the "Windows Boot Loader"

Also usually loaded to 0x7C00, overwriting the Master Boot Record

Finds Boot Configuration Data, which usually is contained in boot.ini

Says exactly where the proper Windows Operating System files are and loads the Windows NT Kernel.

Windows Kernel

Starts Multitasking

Spawns processes that configure Windows to the specific hardware of this computer, including drivers

Spawns User Interface and Windows Logon Screen

User can now start using the computer

Often boot processes, such as Network set up and connections, continue for a while.